Document each global ext/dom constant on its own row#5434
Document each global ext/dom constant on its own row#5434kocsismate wants to merge 1 commit intophp:masterfrom
Conversation
29d1429 to
06253f9
Compare
|
I think from a DX point of view, the new one is worse. I believe they should be documented together for ease. |
|
I agree with @ndossche here. If the tooling is struggling then it's a tooling issue. I am happy to modify the markup if it brings more consistency (e.g. replacing the table with a Converting the table to use the more typical format of a |
|
I think the table format is correct here, as it includes the value, while the list format usually doesn't as far as I know. There's a precedent for a similar situation at https://www.php.net/manual/en/reserved.constants.php: So in my opinion, a similar approach could work fine in case of ext/dom constants: we could mark them as aliases, and document them in the same row. What do you think? Although, I should mention that personally, I don't find the separe row based approach worse, the page even looks cleaner for me because it's easier to overview the constant names. I attach two screenshots for comparison. |
|
We decided that providing the value of a constant is not useful as this is not something people should actually care about. Especially as it could change at any moment by an underlying library. So this is a feature of the list based constant design. Most constant lists are varentrylists and not tables. I also don't want to mention that one of the "legacy" or "new" constants is an alias of another one, and I don't want to duplicate text, as that just gives more work for translators. So having both constants together is the better solution. |
I would make the two constants aliases in the stub file, and document them in the same row. But then what should be written in the name column that works for all DOM constants and for the rest of the aliased constants ( |


Before these changes, the
gen_stub.php --verify-manualcommand used to fail with an exception due to ext/DOM constants being wrongly formatted: the old and new constant counterparts were documented in the same row (e.g.DOM_VALIDATION_ERR/Dom\VALIDATION_ERR) which format cannot be recognized by gen_stub.php. Instead, let's document each constant on its own row.Related to php/php-src#21484